/**  
* @Title: CrShopUserService.java
* @Package com.lemon.service.cityRun
* @Description: (一句话阐述):
* @author Ran_cc
* @date 2018年10月16日
* @version V1.0  
*/
package com.lemon.service.cityRun;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.lemon.mapper.cityRun.CrShopUserMapper;
import com.lemon.model.cityRun.CrShopUser;

/**
 * <p>Title: CrShopUserService</p>
 * <p>Description: 
 * </p>
 * <p>Company: </p>
 * @author Ran_cc
 * @date 2018年10月16日
 * @版本 V 1.0 
 */
@Service
public class CrShopUserServiceImpl implements CrShopUserService {

	@Resource
	private CrShopUserMapper uMapper;

	/**
	 * <p>
	 * Title: selectBySelective
	 * </p>
	 * <p>
	 * Description:(一句话阐述):
	 * </p>
	 * 
	 * @param user
	 * @return
	 * @author Ran_cc
	 * @throws Exception
	 * @date 2018年10月16日
	 */
	@Override
	public CrShopUser selectBySelective(CrShopUser user) throws Exception {
		CrShopUser user2 = uMapper.selectBySelective(user);
		return user2;
	}

	/**
	 * <p>
	 * Title: selectShopUserByAcc
	 * </p>
	 * <p>
	 * Description:(一句话阐述):
	 * </p>
	 * 
	 * @param idInfo
	 * @return
	 * @author Ran_cc
	 * @throws Exception
	 * @date 2018年10月17日
	 */
	@Override
	public CrShopUser selectShopUserByAcc(String idInfo) throws Exception {
		CrShopUser user = new CrShopUser();
		user.setUserAccount(idInfo);
		user.setWhere(" and a.user_status != 0 ");
		CrShopUser user2 = uMapper.selectBySelective(user);
		return user2;
	}

	/**
	 * <p>
	 * Title: selectListBySelective
	 * </p>
	 * <p>
	 * Description:(一句话阐述):
	 * </p>
	 * 
	 * @param user
	 * @return
	 * @author Ran_cc
	 * @throws Exception
	 * @date 2018年10月18日
	 */
	@Override
	public List<CrShopUser> selectListBySelective(CrShopUser user) throws Exception {
		PageHelper.startPage(user.getPageNum() , user.getPageSize());
		List<CrShopUser> list = uMapper.selectListBySelective(user);
		return list;
	}

	/**
	 * <p>
	 * Title: selectAdminListBySelective
	 * </p>
	 * <p>
	 * Description:(一句话阐述):
	 * </p>
	 * 
	 * @param user
	 * @return
	 * @author Ran_cc
	 * @date 2018年10月18日
	 */
	@Override
	public List<CrShopUser> selectAdminListBySelective(CrShopUser user) throws Exception {
		PageHelper.startPage(user.getPageNum() , user.getPageSize());
		List<CrShopUser> list = uMapper.selectAdminListBySelective(user);
		return list;
	}

	/**
	 * <p>
	 * Title: insertAdminUserInfo
	 * </p>
	 * <p>
	 * Description:(一句话阐述):
	 * </p>
	 * 
	 * @param user
	 * @return
	 * @author Ran_cc
	 * @date 2018年10月18日
	 */
	@Override
	public int insertAdminUserInfo(CrShopUser user) throws Exception {
		int i = uMapper.insertSelective(user);
		return i;
	}

	/**
	 * <p>
	 * Title: insertAdminUserInfo
	 * </p>
	 * <p>
	 * Description:(一句话阐述):
	 * </p>
	 * 
	 * @param user
	 * @return
	 * @author Ran_cc
	 * @date 2018年10月18日
	 */
	@Override
	public int updateAdminUserInfo(CrShopUser user) throws Exception {
		int i = uMapper.updateByPrimaryKeySelective(user);
		return i;
	}

	/**
	 * <p>
	 * Title: selectShopListBySelective
	 * </p>
	 * <p>
	 * Description:(一句话阐述):
	 * </p>
	 * 
	 * @param user
	 * @return
	 * @author Ran_cc
	 * @date 2018年10月18日
	 */
	@Override
	public List<CrShopUser> selectShopListBySelective(CrShopUser user) throws Exception {
		PageHelper.startPage(user.getPageNum() , user.getPageSize());
		List<CrShopUser> list = uMapper.selectShopListBySelective(user);
		return list;
	}

	/**
	 * <p>
	 * Title: selectById
	 * </p>
	 * <p>
	 * Description:(一句话阐述):
	 * </p>
	 * 
	 * @param userid
	 * @return
	 * @author Ran_cc
	 * @throws Exception
	 * @date 2018年11月16日
	 */
	@Override
	public CrShopUser selectById(String userid) throws Exception {

		return uMapper.selectByPrimaryKey(userid);
	}

	/**
	 * <p>
	 * Title: updateUserInfo
	 * </p>
	 * <p>
	 * Description:(一句话阐述):
	 * </p>
	 * 
	 * @param user
	 * @author Ran_cc
	 * @throws Exception
	 * @date 2018年11月24日
	 */
	@Override
	public void updateUserInfo(CrShopUser user) throws Exception {
		uMapper.updateByPrimaryKeySelective(user);
	}

}
